#pragma once

#include "paddleocr_post_process.h"
#include <opencv2/opencv.hpp>
#include <vector>

namespace ocr {
struct TextLine {
  std::string text;
  std::vector<float> charScores;
};

struct Angle {
  int index;
  std::string label;
  float score;
};

struct TextBox {
  std::vector<cv::Point> boxPoint;
  float score;
  Angle textAngle;
  TextLine textLine;
};

std::vector<TextBox> det_postprocess(void *data, size_t img_w, size_t img_h,
                                     size_t model_w, size_t model_h);

std::vector<cv::Mat> crop(void *frame, size_t w, size_t h,
                          std::vector<TextBox> &reslut);

// void scoreToTextLine(const int16_t *outputData, TextBox &res,
//                      std::vector<std::string> mKeys, size_t model_h,
//                      size_t model_w);
void scoreToTextLine(const int16_t *outputData, TextBox &res, mKeys *mKeys,
                     size_t model_h, size_t model_w);

} // namespace ocr
